package com.bestcem.xm.member.enums;

import com.bestcem.xm.common.core.enums.CommonEnum;

/**
 * 员工状态
 *
 * @author yf.wang <yf.wang@idiaoyan.com>
 * @version V1.0
 * @date 2021/7/16
 */
public enum EmployeeStatusEnum implements CommonEnum  {

    /**
     * 无状态,表示不是非内部联系人
     */
    MEMBER_EMPLOYEE_STATUS_IGNORE("无状态,表示不是非内部联系人", 0),

    /**
     * 在职
     */
    MEMBER_EMPLOYEE_STATUS_WORK("在职", 1),

    /**
     * 离职
     */
    MEMBER_EMPLOYEE_STATUS_LEAVE("离职", 2);

    private String name;

    private int index;

    EmployeeStatusEnum(String name, int index) {
        this.name = name;
        this.index = index;
    }

    public int getIndex() {
        return index;
    }

    public String getName() {
        return name;
    }

    public static EmployeeStatusEnum getByIndex(int index) {
        EmployeeStatusEnum[] values = EmployeeStatusEnum.values();
        for (EmployeeStatusEnum value : values) {
            if (value.getIndex() == index) {
                return value;
            }
        }
        return null;
    }
}
